function result=isOptExpirationDay(tday)
% result=isOptExpirationDay(tday) returns true if tday is option stopped
% trading day (ususually the third Friday of month), false if otherwise.

expDays=[...
        20000121; 20000218; 20000317; 20000420; 20000519; 20000616; 20000721; 20000818; 20000915; 20001020; 20001117; 20001215; ...
        20010119; 20010216; 20010316; 20010420; 20010518; 20010615; 20010720; 20010817; 20010921; 20011019; 20011116; 20011221; ...
        20020118; 20020215; 20020315; 20020419; 20020517; 20020621; 20020719; 20020816; 20020920; 20021018; 20021115; 20021220; ...
        20030117; 20030221; 20030321; 20030417; 20030516; 20030620; 20030718; 20030815; 20030919; 20031017; 20031121; 20031219; ...
        20040116; 20040220; 20040319; 20040416; 20040521; 20040618; 20040716; 20040820; 20040917; 20041015; 20041119; 20041217; ...
        20050121; 20050218; 20050318; 20050415; 20050520; 20050617; 20050715; 20050819; 20050916; 20051021; 20051118; 20051216];


if (tday&lt;20000101)
    result=isThirdFriday(tday2datenum(tday));
    return;
elseif (tday &gt; 20051231)
    assert(0, 'not enough option expiration dates in table!\n');
end

result=~isempty(find(tday==expDays));
